﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;

namespace Tanks
{
    public abstract class Item
    {
        protected Bitmap Gr;
        protected Game game = Game.Instance();
        protected abstract void Pickup(Tank t);
        public Cell C;
        public void Draw(Bitmap canvas)
        {
            if (C.currTank != null)
            {
                Pickup(C.currTank);
            }

            if (C.Block == BlockType.Empty)
            {
                using (Graphics gr = Graphics.FromImage(canvas))
                {
                    gr.DrawImage(Gr, C.X * game.CellSize, C.Y * game.CellSize);
                }
            }
        }
    }
}
